package com.springcloud.upms.vo;

import lombok.Data;

@Data
public class ResEntity {

    private String code;

    private String msg;

    private Object object;

    private ResEntity(){}



    private   ResEntity(String code,String msg,Object o){
        this.code = code;
        this.msg = msg;
        this.object = o;
    }

    public static  ResEntity ok(String code,String msg,Object o){
        return  new ResEntity(code,msg,o);
    }

    public static  ResEntity ok(String msg,Object o){
        return new ResEntity("200",msg,o);
    }
    public static  ResEntity ok(Object o){
        return new ResEntity("200","操作成功",o);
    }


    public static  ResEntity error(String code,String msg,Object o){
        return  new ResEntity(code,msg,o);
    }

    public static  ResEntity error(String msg,Object o){
        return new ResEntity("500",msg,o);
    }
    public static  ResEntity error(Object o){
        return new ResEntity("500","操作失败",o);
    }


}
